package cn.bobdeng.spc.mainserver;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@SpringBootApplication
@RestController
@EnableJpaRepositories({"cn.bobdeng.spc", "cn.bobdeng.userrole"})
@ComponentScan({"cn.bobdeng.spc", "cn.bobdeng.userrole"})
@EntityScan({"cn.bobdeng.spc", "cn.bobdeng.userrole"})
public class MainserverApplication {
    @Value(("${build.version}"))
    private String version;

    public static void main(String[] args) {
        SpringApplication.run(MainserverApplication.class, args);
    }

    @GetMapping("/")
    public String mainPage() {
        return "it works:" + version;
    }


}
